<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="../js/jquery-3.6.0.min.js" type="text/javascript"></script>

    <script type="text/javascript">

      $(function (){

        $("#filter").click(function (){

            // $("p:contains('文本')").css("color","red");

            // $("p:empty")
            //     .html("空标签")
            //     .css("color","red");

            // $("p:has(b)").css("color","red");

            $("p:parent").css("color","red");



        })
      })


    </script>
</head>
<body>


    <h1>一级标题</h1>
    <h2>二级标题</h2>
    <h3>三级标题</h3>

    <p>文本1</p>
    <p></p>
    <p class="p">文本2</p>
    <p><a>测试3</a><p>
    <p>文本4</p>
    <p></p>
    <p><b>加粗文本</b></p>
    <p class="p">测试5</p>
    <p>文本6</p>

    <input id="filter" type="button" value="内容过滤">

</body>
</html>